expression and _r_e_p_l_a_c_e_m_e_n_t is a string that is substituted
in place of any portion of the dial string that is matched
by the _r_e_g_u_l_a_r-_e_x_p_r_e_s_s_i_o_n. White space is significant in
parsing transformation rules. If a regular expression or
replacement string has embedded white space in it, then the
white space needs to be escaped with a ``\'' character or
the entire string should be enclosed in quote (``"'') marks.
Replacement strings may reference the entire string matched
by the regular expression with the ``&'' character.
Substrings matched with the ``(...)'' constructs may be
referenced by using ``\_n'' where _n is a single numeric digit
between 1 and 9 that refers to the _n-th matched substring;
c.f. _r_e__f_o_r_m_a_t(7), _s_e_d(1), etc.
To simplify and parameterize the construction of rule sets,
dial string rules files may also include simple text-
oriented variable definitions. A line of the form:
_f_o_o====_s_t_r_i_n_g
defines a variable named _f_o_o that has the value _s_t_r_i_n_g.
String values with embedded whitespace must use the ``\''
character or be enclosed in quote marks. Variables are
interpolated into transformation rules by referencing them
as:
$$$${{{{_v_a_r}}}}
Note that variable interpolation is done only once, at the
time a transformation rule is defined. This means that
forward references are not supported and that circular
definitions will not cause loops. The facsimile server
automatically defines four variables to have the values
defined in its configuration file: AAAArrrreeeeaaaaCCCCooooddddeeee, CCCCoooouuuunnnnttttrrrryyyyCCCCooooddddeeee,
LLLLoooonnnnggggDDDDiiiissssttttaaaannnncccceeeePPPPrrrreeeeffffiiiixxxx, and IIIInnnntttteeeerrrrnnnnaaaattttiiiioooonnnnaaaallllPPPPrrrreeeeffffiiiixxxx These variables
are initialized before parsing a dial string rules file;
thus if they are defined in the rules file then they will
override any definition by the server.
There are three well known rule set names: _C_a_n_o_n_i_c_a_l_N_u_m_b_e_r
to convert a dial string to a canonical format, _D_i_a_l_S_t_r_i_n_g
to prepare a dial string before using it to dial the
telephone, and _D_i_s_p_l_a_y_N_u_m_b_e_r to convert a dial string to an
external ``displayable'' form that does not include the
private information that might appear in the raw dial
string.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
This is the default set of rules for transforming a dial
string into a canonical phone number:
Area=${AreaCode} ! local area code
Country=${CountryCode} ! local country code
IDPrefix=${InternationalPrefix} ! prefix for placing an international call
LDPrefix=${LongDistancePrefix} ! prefix for placing a long distance call